Skip to content

Fix for Call to eval-like DOM function - #23

Draft
jf205 wants to merge 1 commit into
masterfrom
finding-autofix-fe071ec2
Draft

Fix for Call to eval-like DOM function#23
jf205 wants to merge 1 commit into
masterfrom
finding-autofix-fe071ec2

Conversation

@jf205

@jf205 jf205 commented Apr 16, 2026

Copy link
Copy Markdown

To fix this without changing intended functionality (displaying the current location), replace each document.write(window.location) with a safe text-rendering approach that does not parse HTML/script.

Best approach in this file: use document.body.appendChild(document.createTextNode(String(window.location)));.
This preserves output of the location value while ensuring it is inserted as plain text, not executable markup.

File/region to change: foo.js, all lines where document.write(window.location); appears (including line 147 and the repeated instances shown).

No new imports, helper methods, or dependencies are needed.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant